﻿// global function for creating namespaces
function namespace(namespaceString) {
    var parts = namespaceString.split('.'),
        parent = window,
        currentPart = '';

    for (var i = 0, length = parts.length; i < length; i++) {
        currentPart = parts[i];
        parent[currentPart] = parent[currentPart] || {};
        parent = parent[currentPart];
    }

    return parent;
}

function validate(selector) {

    var isValid = true;
    $(selector).find(":input").not("input:hidden").each(function () { // if $validator.defaults.ignore is change, the not claus must be changed here
        if (!$(this).valid())
            isValid = false;
    });

    return isValid;
}